]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
swipeTracker: Reset before emitting 'end' and not after
authorAlexander Mikhaylenko <exalm7659@gmail.com>
Sat, 13 Mar 2021 14:57:53 +0000 (19:57 +0500)
committerMarge Bot <marge-bot@gnome.org>
Sat, 13 Mar 2021 18:08:24 +0000 (18:08 +0000)
If the actor is unmapped in the handler, the touch gesture will cancel.
Since we haven't reset the state yet, it will still work and will actually
cancel the gesture, so reset before that instead.

Fixes overview cancelling when trying to open it with a swipe.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1731>

js/ui/swipeTracker.js

index 8f80bfb3e3df91bc7328808958bbdd310cadebc8..9c3671d3cff1569182f006dfc00a8db16c2cb413 100644 (file)
@@ -741,8 +741,8 @@ var SwipeTracker = GObject.registerClass({
         if (duration > 0)
             duration = Math.clamp(duration, MIN_ANIMATION_DURATION, maxDuration);
 
-        this.emit('end', duration, endProgress);
         this._reset();
+        this.emit('end', duration, endProgress);
     }
 
     _cancelTouchGesture(_gesture, time, distance) {